
package com.insigma.business.qrcode.merchant.service.impl;

import com.insigma.business.qrcode.common.service.SequenceGenerator;
import com.insigma.business.qrcode.soldier.dto.SequenceNameConstant;
import com.insigma.business.qrcode.merchant.dao.CareWelfareMerchantStreetRelDao;
import com.insigma.business.qrcode.merchant.dto.search.CareWelfareMerchantStreetRelBSearcher;
import com.insigma.business.qrcode.merchant.entity.CareWelfareMerchantStreetRelDO;
import com.insigma.business.qrcode.merchant.service.CareWelfareMerchantStreetRelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service("careWelfareMerchantStreetRelService")
public class CareWelfareMerchantStreetRelServiceImpl implements CareWelfareMerchantStreetRelService {

    @Autowired(required = false)
    private CareWelfareMerchantStreetRelDao careWelfareMerchantStreetRelDao;
    @Autowired(required = false)
    private SequenceGenerator sequenceGenerator;

    
    @Override
    public List<CareWelfareMerchantStreetRelDO> search(final CareWelfareMerchantStreetRelBSearcher careWelfareMerchantStreetRelBSearcher) {
        return careWelfareMerchantStreetRelDao.search(careWelfareMerchantStreetRelBSearcher);
    }
   
    @Override
    public CareWelfareMerchantStreetRelDO get(final String id){
        return careWelfareMerchantStreetRelDao.get(id);
    }

    
    @Override
    public Integer insert(final CareWelfareMerchantStreetRelDO careWelfareMerchantStreetRelDO){
        careWelfareMerchantStreetRelDO.setId(sequenceGenerator.genKey(SequenceNameConstant.CARE_WELFARE_MERCHANT_STREET_REL_ID));
        return careWelfareMerchantStreetRelDao.insert(careWelfareMerchantStreetRelDO);
    }

    
    @Override
    public Integer update(final CareWelfareMerchantStreetRelDO careWelfareMerchantStreetRelDO){
        return careWelfareMerchantStreetRelDao.update(careWelfareMerchantStreetRelDO);
    }

    
    @Override
    public Integer delete(final String id, final String modifierType, final String modifierId){
        return careWelfareMerchantStreetRelDao.delete(id,modifierType,modifierId);
    }

    @Override
    public CareWelfareMerchantStreetRelDO getByStreetIdAndMerchantId(String streetId, String merchantId) {
        return careWelfareMerchantStreetRelDao.getByStreetIdAndMerchantId(streetId,merchantId);
    }

}
